package com.lh.project.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lh.project.model.entity.CommentReply;
import com.lh.project.model.entity.User;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @Entity com.lh.project.model.entity.CommentReply
*/
public interface CommentReplyMapper extends BaseMapper<CommentReply> {


    @Select("select * from comment_reply where id in ${commentReplyList}")
    @Results({
            @Result(column = "id",property = "id"),
            @Result(column = "content",property = "content"),
            @Result(column = "user_id",property = "user",javaType = User.class,
                one =@One(select = "com.lh.project.mapper.UserMapper.selectById")
            ),
            @Result(column = "comment_id",property = "commentUser",javaType = User.class,
                one=@One(select = "com.lh.project.mapper.UserMapper.selectById")
            ),
            @Result(column = "create_time",property = "createTime"),
            @Result(column = "comment_like",property = "commentLike"),
            @Result(column = "is_delete",property = "isDelete")
    })
//    List<CommentReply> getByIds(List<Long> commentReplyList);
    List<CommentReply> getByIds(String commentReplyList);
}
